#pragma once
#include "SplitToolCppJieba.h"
#include <string>
#include <vector>
#include <utility>
#include <map>
#include <set>

using std::string;
using std::vector;
using std::pair;
using std::map;
using std::set;

class DictProducer
{
    public:
        DictProducer(const string &dir);
        DictProducer(const string &dir, SplitTool *_splitTool);
        ~DictProducer();
        void buildEnDict();
        void buildCnDict();
        void storeDict(const char * Dictfilepath, const char * Idxfilepath);
        void showFiles() const;
        void showDict() const;
        void mergeTXT(const string &filepath);
    private:
        void readDir(const string &dir);
        void readEnFile(const string &filepath);
        void readCnFile(const string &filepath);
        void readDel(const string &filepath);
    private:
        vector<string> _files;
        vector<pair<string, int>> _dict;
        map<string, int> _mdict;
        vector<string> _del;
        SplitTool *_splitTool;
        map<string ,set<int>> _index;

};

